﻿var globelVary={languageId:1,
				sessionTimeBool:0,//1表示超时,0表示未超时
				timeMashine:""
};

/**
 * 用户投票js效果
 * @id 支持的评论ID
 * @type投票种类，1为支持，2为反对
 */
function commentVote(id, type) {
	var $against = $('#against' + id);
	var $agree = $('#agree' + id);
	if (type == 1) { //为支持时			
		if ($agree.children('span').length > 0 || $against.children('span').length > 0) { //判断span元素是否存在
			alert('您已经投过票了');
		} else { // 不存在
			$agree.css('position', 'relative'); //添加样式		
			var agreeSpan = '<span class="" style="position: absolute; text-align: center; left: 6px; top: -35px; display: block; width: 30px; height: 30px; background-image: url(images/agree.gif); opacity: 1; background-position: 0% 50%; background-repeat: no-repeat no-repeat;"></span>';
			$agree.append(agreeSpan);
			$agree.children('span').animate({
				top: 'toggle',
				opacity: 'toggle'
			}, 1000); //动画效果
			$agree.css('cursor', 'text');
		}
	} else if (type == 2) { //为返回时
		if ($agree.children('span').length > 0 || $against.children('span').length > 0) {
			alert('您已经投过票了');
		} else {
			$against.css('position', 'relative'); //添加样式		
			var agreeSpan = '<span class="" style="position: absolute; text-align: center; left: 6px; top: -35px; display: block; width: 30px; height: 30px; background-image: url(images/against.gif); opacity: 1; background-position: 0% 50%; background-repeat: no-repeat no-repeat;"></span>';
			$against.append(agreeSpan);
			$against.children('span').animate({
				top: 'toggle',
				opacity: 'toggle'
			}, 1000); //动画效果
			$against.css('cursor', 'text');
		}

	} else {
		alert("参数传入错误");
	}

}

$(function(){
	if(isNaN($("#itemLanguage").val()))
		globelVary.languageId=1;
	else
		globelVary.languageId=parseInt($("#itemLanguage").val());	
	})



///******会员注册******/

/******会员登陆******/
function userLogin(userLabelId){
	$("#userSubmitLogin"+userLabelId).click(function(){
		var userNameLogin = $("#userNameLogin"+userLabelId).val(); 
		var passwordLogin = $.md5($("#passwordLogin"+userLabelId).val()); 
		var userLoginCheckcode = $("#userLoginCheckcode"+userLabelId).val();
		var data = {userNameLogin:userNameLogin,passwordLogin:passwordLogin,userLoginCheckcode:userLoginCheckcode,userLabelId:userLabelId}; 
		$.ajax({ 
			type: "POST", 
			url: "/apply/member/userLogin.asp", 
			data:data, 
			cache:false, 
			error:function(){ 
				createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}]);
				return false; 
			}, 
			success: function(data){ 	
				try{
					var dataMsg=eval("("+data+")"); 							
					if(dataMsg.status=="failed"){
						createDialog({title:transKeyWords(globelVary.languageId,8),con:dataMsg.msg,type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}]);						 
						return false; 
					}
				}catch(error){				
					$(".user_login_sub2").replaceWith(data);
					var ccImg = document.getElementById("imgcheckcode"+userLabelId);//刷新验证码
					if (ccImg)
					{
						ccImg.src = "/inc/checkcode.asp?t="+(new Date().getTime());
					}
					createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,3),type:"success",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}]);					
				}
			} 
		});												 
	})
}




/*!
 * SuperSlide v2.1.1 
 * v2.1.1：修复当调用多个SuperSlide，并设置returnDefault:true 时返回defaultIndex索引错误
 */

(function($){
	$.fn.slide=function(options){
		$.fn.slide.defaults={
		type:"slide", 
		effect:"fade", 
		autoPlay:false, 
		delayTime:500, 
		interTime:2500,
		triggerTime:150,
		defaultIndex:0,
		titCell:".hd li",
		mainCell:".bd",
		targetCell:null,
		trigger:"mouseover",
		scroll:1,
		vis:1,
		titOnClassName:"on",
		autoPage:false, 
		prevCell:".prev",
		nextCell:".next",
		pageStateCell:".pageState",
		opp: false, 
		pnLoop:true, 
		easing:"swing", 
		startFun:null,
		endFun:null,
		switchLoad:null,

		playStateCell:".playState",
		mouseOverStop:true,
		defaultPlay:true,
		returnDefault:false 
		};

		return this.each(function() {

			var opts = $.extend({},$.fn.slide.defaults,options);
			var slider = $(this);
			var effect = opts.effect;
			var prevBtn = $(opts.prevCell, slider);
			var nextBtn = $(opts.nextCell, slider);
			var pageState = $(opts.pageStateCell, slider);
			var playState = $(opts.playStateCell, slider);

			var navObj = $(opts.titCell, slider);//导航子元素结合
			var navObjSize = navObj.size();
			var conBox = $(opts.mainCell , slider);//内容元素父层对象.bd  
			var conBoxSize=conBox.children().size();
			var sLoad=opts.switchLoad;
			var tarObj = $(opts.targetCell, slider);

			/*字符串转换*/
			var index=parseInt(opts.defaultIndex);
			var delayTime=parseInt(opts.delayTime);
			var interTime=parseInt(opts.interTime);
			var triggerTime=parseInt(opts.triggerTime);
			var scroll=parseInt(opts.scroll);
			var vis=parseInt(opts.vis);
			var autoPlay = (opts.autoPlay=="false"||opts.autoPlay==false)?false:true;
			var opp = (opts.opp=="false"||opts.opp==false)?false:true;
			var autoPage = (opts.autoPage=="false"||opts.autoPage==false)?false:true;
			var pnLoop = (opts.pnLoop=="false"||opts.pnLoop==false)?false:true;
			var mouseOverStop = (opts.mouseOverStop=="false"||opts.mouseOverStop==false)?false:true;
			var defaultPlay = (opts.defaultPlay=="false"||opts.defaultPlay==false)?false:true;
			var returnDefault = (opts.returnDefault=="false"||opts.returnDefault==false)?false:true;

			var slideH=0;
			var slideW=0;
			var selfW=0;
			var selfH=0;
			var easing=opts.easing;
			var inter=null;//autoPlay-setInterval 
			var mst =null;//trigger-setTimeout
			var rtnST=null;//returnDefault-setTimeout
			var titOn = opts.titOnClassName;

			var onIndex = navObj.index( slider.find( "."+titOn) );
			var oldIndex = index = onIndex==-1?index:onIndex;
			var defaultIndex = index;


			var _ind = index;
			var cloneNum = conBoxSize>=vis?( conBoxSize%scroll!=0?conBoxSize%scroll:scroll):0; 
			var _tar;
			var isMarq = effect=="leftMarquee" || effect=="topMarquee"?true:false;

			var doStartFun=function(){ if ( $.isFunction( opts.startFun) ){ opts.startFun( index,navObjSize,slider,$(opts.titCell, slider),conBox,tarObj,prevBtn,nextBtn ) } }
			var doEndFun=function(){ if ( $.isFunction( opts.endFun ) ){ opts.endFun( index,navObjSize,slider,$(opts.titCell, slider),conBox,tarObj,prevBtn,nextBtn ) } }
			var resetOn=function(){ navObj.removeClass(titOn); if( defaultPlay ) navObj.eq(defaultIndex).addClass(titOn)  }



			//单独处理菜单效果
			if( opts.type=="menu" ){

				if( defaultPlay ){ navObj.removeClass(titOn).eq(index).addClass(titOn); }
				navObj.hover(
						function(){
							_tar=$(this).find( opts.targetCell );
							var hoverInd =navObj.index($(this));
						
							mst = setTimeout(function(){  
								index=hoverInd;
								navObj.removeClass(titOn).eq	(index).addClass(titOn);
								doStartFun();
								switch (effect)
								{
									case "fade":_tar.stop(true,true).animate({opacity:"show"}, delayTime,easing,doEndFun ); break;
									case "slideDown":_tar.stop(true,true).animate({height:"show"}, delayTime,easing,doEndFun ); break;
								}
							} ,opts.triggerTime);

						},function(){
							clearTimeout(mst);
							switch (effect){ case "fade":_tar.animate( {opacity:"hide"},delayTime,easing ); break; case "slideDown":_tar.animate( {height:"hide"},delayTime,easing ); break; }
						}
				);

				if (returnDefault){ 
					slider.hover(function(){clearTimeout(rtnST);},function(){ rtnST = setTimeout( resetOn,delayTime ); });
				}
				return;
			}

			
			//处理分页
			if( navObjSize==0 )navObjSize=conBoxSize;//只有左右按钮
			if( isMarq ) navObjSize=2;
			if( autoPage ){
				if(conBoxSize>=vis){
					if( effect=="leftLoop" || effect=="topLoop" ){ navObjSize=conBoxSize%scroll!=0?(conBoxSize/scroll^0)+1:conBoxSize/scroll; }
					else{ 
							var tempS = conBoxSize-vis;
							navObjSize=1+parseInt(tempS%scroll!=0?(tempS/scroll+1):(tempS/scroll)); 
							if(navObjSize<=0)navObjSize=1; 
					}
				}
				else{ navObjSize=1 }
				navObj.html(""); 
				var str="";

				if( opts.autoPage==true || opts.autoPage=="true" ){ for( var i=0; i<navObjSize; i++ ){ str+="<li>"+(i+1)+"</li>" } }
				else{ for( var i=0; i<navObjSize; i++ ){ str+=opts.autoPage.replace("$",(i+1))  } }
				navObj.html(str); 				
				var navObj = navObj.children();//重置导航子元素对象
			}


			if(conBoxSize>=vis){ //当内容个数少于可视个数，不执行效果。
				conBox.children().each(function(){ //取最大值
					if( $(this).width()>selfW ){ selfW=$(this).width(); slideW=$(this).outerWidth(true);  }
					if( $(this).height()>selfH ){ selfH=$(this).height(); slideH=$(this).outerHeight(true);  }
				});

				var _chr = conBox.children();
				var cloneEle = function(){ 
					for( var i=0; i<vis ; i++ ){ _chr.eq(i).clone().addClass("clone").appendTo(conBox); } 
					for( var i=0; i<cloneNum ; i++ ){ _chr.eq(conBoxSize-i-1).clone().addClass("clone").prependTo(conBox); }
				}
				
				switch(effect)
				{
					case "fold": conBox.css({"position":"relative","width":slideW,"height":slideH}).children().css( {"position":"absolute","width":selfW,"left":0,"top":0,"display":"none"} ); break;
					case "top": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "top":-(index*scroll)*slideH, "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfH} ); break;
					case "left": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":conBoxSize*slideW,"left":-(index*scroll)*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfW} ); break;
					case "leftLoop":
					case "leftMarquee":
						cloneEle();
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":(conBoxSize+vis+cloneNum)*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-(cloneNum+index*scroll)*slideW}).children().css( {"float":"left","width":selfW}  ); break;
					case "topLoop":
					case "topMarquee":
						cloneEle();
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "height":(conBoxSize+vis+cloneNum)*slideH,"position":"relative","padding":"0","margin":"0","top":-(cloneNum+index*scroll)*slideH}).children().css( {"height":selfH} ); break;
				}
			}



			//针对leftLoop、topLoop的滚动个数
			var scrollNum=function(ind){ 
				var _tempCs= ind*scroll; 
				if( ind==navObjSize ){ _tempCs=conBoxSize; }else if( ind==-1 && conBoxSize%scroll!=0){ _tempCs=-conBoxSize%scroll; }
				return _tempCs;
			}

			//切换加载
			var doSwitchLoad=function(objs){ 

					var changeImg=function(t){
						for ( var i= t; i<( vis+ t); i++ ){
								objs.eq(i).find("img["+sLoad+"]").each(function(){ 
									var _this =  $(this);
									_this.attr("src",_this.attr(sLoad)).removeAttr(sLoad);
									if( conBox.find(".clone")[0] ){ //如果存在.clone
										var chir = conBox.children();
										for ( var j=0 ; j< chir.size() ; j++ )
										{
											chir.eq(j).find("img["+sLoad+"]").each(function(){
												if( $(this).attr(sLoad)==_this.attr("src") ) $(this).attr("src",$(this).attr(sLoad)).removeAttr(sLoad) 
											})
										}
									}
								})
							}
					}

					switch(effect)
					{
						case "fade": case "fold": case "top": case "left": case "slideDown":
							changeImg( index*scroll );
							break;
						case "leftLoop": case "topLoop":
							changeImg( cloneNum+scrollNum(_ind) );
							break;
						case "leftMarquee":case "topMarquee": 
							var curS = effect=="leftMarquee"? conBox.css("left").replace("px",""):conBox.css("top").replace("px",""); 
							var slideT = effect=="leftMarquee"? slideW:slideH; 
							var mNum=cloneNum;
							if( curS%slideT!=0 ){
								var curP = Math.abs(curS/slideT^0);
								if( index==1 ){ mNum=cloneNum+curP }else{  mNum=cloneNum+curP-1  }
							}
							changeImg( mNum );
							break;
					}
			}//doSwitchLoad end


			//效果函数
			var doPlay=function(init){
				 // 当前页状态不触发效果
				if( defaultPlay && oldIndex==index && !init && !isMarq ) return;
				
				//处理页码
				if( isMarq ){ if ( index>= 1) { index=1; } else if( index<=0) { index = 0; } }
				else{ 
					_ind=index; if ( index >= navObjSize) { index = 0; } else if( index < 0) { index = navObjSize-1; }
				}

				doStartFun();

				//处理切换加载
				if( sLoad!=null ){ doSwitchLoad( conBox.children() ) }

				//处理targetCell
				if(tarObj[0]){ 
					_tar = tarObj.eq(index);
					if( sLoad!=null ){ doSwitchLoad( tarObj ) }
					if( effect=="slideDown" ){
							tarObj.not(_tar).stop(true,true).slideUp(delayTime); 
							_tar.slideDown( delayTime,easing,function(){ if(!conBox[0]) doEndFun() }); 
					}
					else{
							tarObj.not(_tar).stop(true,true).hide();
							_tar.animate({opacity:"show"},delayTime,function(){ if(!conBox[0]) doEndFun() }); 
					}
				}
				
				if(conBoxSize>=vis){ //当内容个数少于可视个数，不执行效果。
					switch (effect)
					{
						case "fade":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().hide(); break;
						case "fold":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().animate({opacity:"hide"},delayTime,easing);break;
						case "top":conBox.stop(true,false).animate({"top":-index*scroll*slideH},delayTime,easing,function(){doEndFun()});break;
						case "left":conBox.stop(true,false).animate({"left":-index*scroll*slideW},delayTime,easing,function(){doEndFun()});break;
						case "leftLoop":
							var __ind = _ind;
							conBox.stop(true,true).animate({"left":-(scrollNum(_ind)+cloneNum)*slideW},delayTime,easing,function(){
								if( __ind<=-1 ){ conBox.css("left",-(cloneNum+(navObjSize-1)*scroll)*slideW);  }else if( __ind>=navObjSize ){ conBox.css("left",-cloneNum*slideW); }
								doEndFun();
							});
							break;//leftLoop end

						case "topLoop":
							var __ind = _ind;
							conBox.stop(true,true).animate({"top":-(scrollNum(_ind)+cloneNum)*slideH},delayTime,easing,function(){
								if( __ind<=-1 ){ conBox.css("top",-(cloneNum+(navObjSize-1)*scroll)*slideH);  }else if( __ind>=navObjSize ){ conBox.css("top",-cloneNum*slideH); }
								doEndFun();
							});
							break;//topLoop end

						case "leftMarquee":
							try{
							var tempLeft = conBox.css("left").replace("px",""); }
							catch(e){return;}
							if(index==0 ){
									conBox.animate({"left":++tempLeft},0,function(){
										if( conBox.css("left").replace("px","")>= 0){ conBox.css("left",-conBoxSize*slideW) }
									});
							}
							else{
									conBox.animate({"left":--tempLeft},0,function(){
										if(  conBox.css("left").replace("px","")<= -(conBoxSize+cloneNum)*slideW){ conBox.css("left",-cloneNum*slideW) }
									});
							}break;// leftMarquee end

							case "topMarquee":
							 try{
								 var tempTop = conBox.css("top").replace("px","");								
								}
							catch(err){													
								break;
								}	 						
							
							if(index==0 ){
									conBox.animate({"top":++tempTop},0,function(){
										if( conBox.css("top").replace("px","")>= 0){ conBox.css("top",-conBoxSize*slideH) }
									});
							}
							else{
									conBox.animate({"top":--tempTop},0,function(){
										if(  conBox.css("top").replace("px","")<= -(conBoxSize+cloneNum)*slideH){ conBox.css("top",-cloneNum*slideH) }
									});
							}break;// topMarquee end

					}//switch end
				}

					navObj.removeClass(titOn).eq(index).addClass(titOn);
					oldIndex=index;
					if( !pnLoop ){ //pnLoop控制前后按钮是否继续循环
						nextBtn.removeClass("nextStop"); prevBtn.removeClass("prevStop");
						if (index==0 ){ prevBtn.addClass("prevStop"); }
						if (index==navObjSize-1 ){ nextBtn.addClass("nextStop"); }
					}

					pageState.html( "<span>"+(index+1)+"</span>/"+navObjSize);

			};// doPlay end

			//初始化执行
			if( defaultPlay ){ doPlay(true); }

			if (returnDefault)//返回默认状态
			{
				slider.hover(function(){ clearTimeout(rtnST) },function(){
						rtnST = setTimeout( function(){
							index=defaultIndex;
							if(defaultPlay){ doPlay(); }
							else{
								if( effect=="slideDown" ){ _tar.slideUp( delayTime, resetOn ); }
								else{ _tar.animate({opacity:"hide"},delayTime,resetOn ); }
							}
							oldIndex=index;
						},300 );
				});
			}
			

			///自动播放函数
			var setInter = function(time){ inter=setInterval(function(){  opp?index--:index++; doPlay() }, !!time?time:interTime);  }
			var setMarInter = function(time){ inter = setInterval(doPlay, !!time?time:interTime);  }
			// 处理mouseOverStop
			var resetInter = function(){ if( !mouseOverStop ){clearInterval(inter); setInter() } }
			// 前后按钮触发
			var nextTrigger = function(){ if ( pnLoop || index!=navObjSize-1 ){ index++; doPlay(); if(!isMarq)resetInter(); } }
			var prevTrigger = function(){ if ( pnLoop || index!=0 ){ index--; doPlay(); if(!isMarq)resetInter(); } }
			//处理playState
			var playStateFun = function(){ clearInterval(inter); isMarq?setMarInter():setInter(); playState.removeClass("pauseState") }
			var pauseStateFun = function(){ clearInterval(inter);playState.addClass("pauseState"); }

			//自动播放
			if (autoPlay) {
					if( isMarq ){ 
						opp?index--:index++; setMarInter();
						if(mouseOverStop) conBox.hover(pauseStateFun,playStateFun);
					}else{
						setInter();
						if(mouseOverStop) slider.hover( pauseStateFun,playStateFun );
					}
			}
			else{ if( isMarq ){ opp?index--:index++; } playState.addClass("pauseState"); }

			playState.click(function(){  playState.hasClass("pauseState")?playStateFun():pauseStateFun()  });

			//titCell事件
			if(opts.trigger=="mouseover"){
				navObj.hover(function(){ var hoverInd = navObj.index(this);  mst = setTimeout(function(){  index=hoverInd; doPlay(); resetInter();  },opts.triggerTime); }, function(){ clearTimeout(mst) });
			}else{ navObj.click(function(){ index=navObj.index(this); doPlay(); resetInter(); })  }

			//前后按钮事件
			if (isMarq){
				
				nextBtn.mousedown(nextTrigger);
				prevBtn.mousedown(prevTrigger);
				//前后按钮长按10倍加速
				if (pnLoop)
				{	
					var st;
					var marDown = function(){ st=setTimeout(function(){ clearInterval(inter); setMarInter( interTime/10^0 ) },150) }
					var marUp = function(){ clearTimeout(st); clearInterval(inter); setMarInter() }
					nextBtn.mousedown(marDown); nextBtn.mouseup(marUp);
					prevBtn.mousedown(marDown); prevBtn.mouseup(marUp);
				}
				//前后按钮mouseover事件
				if( opts.trigger=="mouseover"  ){ nextBtn.hover(nextTrigger,function(){}); prevBtn.hover(prevTrigger,function(){}); }
			}else{
				nextBtn.click(nextTrigger);
				prevBtn.click(prevTrigger);
			}

    	});//each End

	};//slide End

})(jQuery);

jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d); },
	easeInQuad: function (x, t, b, c, d) {return c*(t/=d)*t + b;},
	easeOutQuad: function (x, t, b, c, d) {return -c *(t/=d)*(t-2) + b},
	easeInOutQuad: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t + b;return -c/2 * ((--t)*(t-2) - 1) + b},
	easeInCubic: function (x, t, b, c, d) {return c*(t/=d)*t*t + b},
	easeOutCubic: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b},
	easeInOutCubic: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b},
	easeInQuart: function (x, t, b, c, d) {return c*(t/=d)*t*t*t + b},
	easeOutQuart: function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b},
	easeInOutQuart: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t + b;return -c/2 * ((t-=2)*t*t*t - 2) + b},
	easeInQuint: function (x, t, b, c, d) {return c*(t/=d)*t*t*t*t + b},
	easeOutQuint: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t*t*t + 1) + b},
	easeInOutQuint: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;return c/2*((t-=2)*t*t*t*t + 2) + b},
	easeInSine: function (x, t, b, c, d) {return -c * Math.cos(t/d * (Math.PI/2)) + c + b},
	easeOutSine: function (x, t, b, c, d) {return c * Math.sin(t/d * (Math.PI/2)) + b},
	easeInOutSine: function (x, t, b, c, d) {return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b},
	easeInExpo: function (x, t, b, c, d) {return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b},
	easeOutExpo: function (x, t, b, c, d) {return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b},
	easeInOutExpo: function (x, t, b, c, d) {if (t==0) return b;if (t==d) return b+c;if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;return c/2 * (-Math.pow(2, -10 * --t) + 2) + b},
	easeInCirc: function (x, t, b, c, d) {return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b},
	easeOutCirc: function (x, t, b, c, d) {return c * Math.sqrt(1 - (t=t/d-1)*t) + b},
	easeInOutCirc: function (x, t, b, c, d) {if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b},
	easeInElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b},
	easeOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b},
	easeInOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b},
	easeInBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*(t/=d)*t*((s+1)*t - s) + b},
	easeOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b},
	easeInOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b},
	easeInBounce: function (x, t, b, c, d) {return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b},
	easeOutBounce: function (x, t, b, c, d) {if ((t/=d) < (1/2.75)) {	return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) {	return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) {	return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else {	return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}},
	easeInOutBounce: function (x, t, b, c, d) {if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;}
});


/**div加载ajax效果***/
function fwajaxStar(str){//str提示信息
	var html="";
	 html+="<div id='fwajaxLoadDiv'></div>";
	 html+="<div class='fwajaxLoadIcon'>";
	html+= "<span class='fwajaxIcon'></span>";
	 if(str)
	 	html+="<span class='fwajaxInfo'>"+str+"</span>";
	 html+="</div>";
	$("body").append(html);	
	var divH=$(document).height();//-$("#admin_topbj").height();
	$("#fwajaxLoadDiv").height(divH).css({"top":0,"opacity":0.5,"left":0});
	var iconTop=$(window).height()/2;
	iconTop=iconTop+$(document).scrollTop();
	$(".fwajaxLoadIcon").css({"top":iconTop+"px"});		
	getSessionTimeBool();
	}

/****关闭ajax遮罩*****/
function fwajaxClose(){	
	$("#fwajaxLoadDiv").remove();
	$(".fwajaxLoadIcon").remove();
}


//添加收藏
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert(transKeyWords(globelVary.languageId,39));
        }
    }
}
//设为首页
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                        } 
                        catch (e)  {
                                alert(transKeyWords(globelVary.languageId,40)); 
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}

/**********多语翻译****************/
function transKeyWords(n, order){
	var content={};
	for(var i=1;i<=9;i++){content[i]={};}
	//中文	
	content[1][1] = "服务器连接错误";
    content[1][2] = "设置成功";
    content[1][3] = "登陆成功";
    content[1][4] = "缺少表情赋值对象";
    content[1][5] = "关闭";
    content[1][6] = "类型不存在";
    content[1][7] = "数据正在获取中";
    content[1][8] = "系统提示";
    content[1][9] = "请正确填写登录账号";
    content[1][10] = "密码为空无法登录";
    content[1][11] = "验证码为空了";
    content[1][12] = "提示";
    content[1][13] = "返回参数异常";
    content[1][14] = "参数异常,保存失败";
    content[1][15] = "是关键字,无法提交";
    content[1][16] = "有未知类型控件";
    content[1][17] = "填写错误";
    content[1][18] = "为必填项";
    content[1][19] = "不是必填项";
    content[1][20] = "不是数字";
    content[1][21] = "填写正确";
    content[1][22] = "不是字母";
    content[1][23] = "电话格式有误";
    content[1][24] = "手机格式有误";
    content[1][25] = "请正确填写邮箱格式";
    content[1][26] = "请正确填写购物数量";
    content[1][27] = "标题";
    content[1][28] = "请选择邮递方式";
    content[1][29] = "请选择付款方式";
    content[1][30] = "添加商品到购物车失败";
	content[1][31] = "评论成功，等待审核";
	content[1][32] = "留言成功";
	content[1][33] = "无法完成计算";
	content[1][34] = "收货人不能为空";
	content[1][35] = "收货地址不能为空";
	content[1][36] = "联系方式不能为空";
	content[1][37] = "请选择配送方式";
	content[1][38] = "请选择付款方式";
	content[1][39] = "加入收藏失败，请使用Ctrl+D进行添加";
	content[1][40] = "此操作被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'";
   	content[1][41] = "展开";
	content[1][42] = "客服中心";
	content[1][43] = "暂无在线客服";
	content[1][44] = "点击这里";
	content[1][45] = "请先开通企业型或通用型再进行操作";
	content[1][46] = "发表成功" 
	return content[n][order];
}


/***************************前台的会员,购物*********************************/
/**********会员****************/
function loadContentAjax(obj){
	var html="<div>"+transKeyWords(globelVary.languageId,7)+"......</div>";
	obj.html(html);
	}
function closeContentAjax(obj){
	obj.html("");
	}
//会员登录界面
$("#passWord,#msgCheckcode").live("keyup",function(e){
		var code=e.which;
		if(code==13){
			if($(".systemDialog ").length>=2)
				return;
			else 
				memLog();			
			}			
		});	

function help() {
	createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}])
}
/*会员登录的请求*/
function openMen(){
	//fwajaxStar();
	/*$.ajax({
		url:"",
		data:{sType:""},
		type:"POST",
		dataType:"html",
		cache:"false",
		error: function(){
			fwajaxClose()
			createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}])
			},
		success:function(data){				
			fwajaxClose();
			createDialog({title:transKeyWords(globelVary.languageId,8),con:data,type:"edit",head:"no"},[])
			}
		});*/
	}		
//会员的验证码	
function msgCheckcodeFocus(){
	var src='/inc/checkcode.asp?t='+(new Date().getTime());
	$("#imgcheckcode").attr("src",src).show();;
	}
	
//会员登录方法
function memLog(){
	var memberName = $.trim($("#memberName").val());
	var passWord = $.trim($("#passWord").val());
	var RadCode = $.trim($(".RadCode").val());	
	if(memberName==""){
		createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,9),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);return;
		}
	if(passWord==""){
		createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,10),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);return;
		}
	if(RadCode==""){
		createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,11),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);return;
		}	
	$.ajax({
		url:"/apply/member/login.asp",
		data:{sType:"memLog",memberName:memberName,passWord:passWord,RadCode:RadCode},
		type:"POST",
		dataType:"json",
		error:function(){
			createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error"},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);
			},
		success:function(data){
			if(data.status=="failed")
			createDialog({title:transKeyWords(globelVary.languageId,8),con:data.msg,type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}])
			else if(data.status=="success")	{
				createDialog({title:transKeyWords(globelVary.languageId,12),con:data.msg,type:"success",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}]);
				$("#timeSessionMashine").val("guoyansi");
				controlTimeMashine();
				//closeDialog($(".user_login"))
				//createDialog({title:"系统提示",con:data.msg,type:"edit",head:"no"},[])
				//memberCenterShow('/apply/member/memberInfo.asp');
				}					
			else 
			createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,13),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}])
			}
		})
	}
	
//=====会员注册,会员信息提交
function memberInfo_submit(className,type){	
			var data=getRegData(className);			
			if(data==0)
			return;
			var url;	
			if(type=="add"){
				url="/apply/member/memberReg.asp";
				data.sType="add";
				}
			else if(type=="save"){
				url="/apply/member/memberInfo.asp";
				data.sType="save";
				}
				fwajaxStar();
				$.ajax({
					url:url,
					data:data,
					dataType:"json",
					type:"POST",
				    cache:false,
					error: function(){
						fwajaxClose();
						createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);
						},
					success: function(data){
						fwajaxClose();
						if(data.status=="success")
							createDialog({title:transKeyWords(globelVary.languageId,12),con:data.msg,type:"success",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}]);
						else if(data.status=="failed")
							createDialog({title:transKeyWords(globelVary.languageId,12),con:data.msg,type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);
						else 
							createDialog({title:transKeyWords(globelVary.languageId,12),con:transKeyWords(globelVary.languageId,14),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);
						}
					});		
			}	
	
//==========得到注册数据
function getRegData(className){
			var data={};//={sType:"add"};
			var getStr=function(name,con){
				con=$.trim(con);
				if(!data[name])
					data[name]=con;
				else{
					data[name]+=","+con;	
					}
				}
			var n=0;var titles="";
			$("."+className,$(".user_login_form")).each(function() {
                var name=$(this).attr("name");
				var type=$(this).attr("type");
				titles=$(this).attr("titles");		
				
				
				if(type=="text"||type=="textarea"||type=="password"){
					var con=$.trim($(this).val());					
					if(con=="system_null"){n=1;return false;}//关键字
					if($(this).attr("submit")=="no"){n=3;return false;}//验证错误
					if($(this).attr("regischeck")==1&&con==""){n=4;return false;}//必填项
					getStr(name,con);
					}
				else if(type=="radio"||type=="checkbox"){
					if($(this).attr("checked")=="checked")
						getStr(name,$(this).val());
					}
				/* else if(type=="password"){
					getStr(name,$(this).val());
					} */				
				else{
					n=2;
					return false;
					}							
            	});					
				if(!memberNotice(n,titles))
				return 0;
				for(var i=1;i<=10;i++){
					if(!data["regMem"+i])
					data["regMem"+i]="system_null";
					}
				return data;
				}
function memberNotice(n,titles){
			var con="";var bool=true;
			if(n==1) {con="system_null"+transKeyWords(globelVary.languageId,15);bool=false;}					
			else if(n==2){con=transKeyWords(globelVary.languageId,16);bool=false;}					
			else if(n==3) {con=titles+transKeyWords(globelVary.languageId,17);bool=false;}
			else if(n==4){con=titles+transKeyWords(globelVary.languageId,18);bool=false;}
			if(!bool){createDialog({title:transKeyWords(globelVary.languageId,12),con:con,type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);return false;}
			return true;			
			}			
	
//会员资料验证
function memberRegValidata(className){			
			$("."+className,$(".user_login_form")).each(function() {
				var type=$(this).attr("type");
				if(typeof type=="undefined")
					type=$(this).get(0).tagName;			
                if(type=="text"||type=="TEXTAREA"){
					var regtype=$(this).attr("regtype");
					var data={};
					var regischeck=$(this).attr("regischeck");
					if(regischeck==0)//飞必填
						data.empty=transKeyWords(globelVary.languageId,19);
					else if(regischeck==1)//必填						
						{
							//data.empty=transKeyWords(globelVary.languageId,18);									
							}
					//纯数字格式
					if(regtype==5){data.type="number";data.error=transKeyWords(globelVary.languageId,20);data.right=transKeyWords(globelVary.languageId,21);data.width=200;$(this).fwValidateText(data);}
					//纯字母格式
					else if(regtype==6){data.type="english";data.error=transKeyWords(globelVary.languageId,22);data.right=transKeyWords(globelVary.languageId,21);data.width=200;$(this).fwValidateText(data);}
					//电话格式
					else if(regtype==7){data.type="tel";data.error=transKeyWords(globelVary.languageId,23);data.right=transKeyWords(globelVary.languageId,21);data.width=200;$(this).fwValidateText(data);}
					//手机格式
					else if(regtype==8){data.type="phone";data.error=transKeyWords(globelVary.languageId,24);data.right=transKeyWords(globelVary.languageId,21);data.width=200;$(this).fwValidateText(data);}
					//邮箱格式
					else if(regtype==9){data.type="email";data.error=transKeyWords(globelVary.languageId,25);data.right=transKeyWords(globelVary.languageId,21);data.width=200;$(this).fwValidateText(data);}									
					}
            	});
			}			
	
//免费注册
function freeReg(){
	fwajaxStar();
	$.ajax({
		url:"/apply/member/memberReg.asp",
		data:{sType:""},
		type:"POST",
		dataType:"html",
		cache:"false",
		error: function(){
			fwajaxClose();
			createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}])
			},
		success:function(data){	
			fwajaxClose();		
			createDialog({title:transKeyWords(globelVary.languageId,8),con:data,type:"edit",head:"no"},[])
			}
		});
	}	
function freeReg1(){
	createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,45),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}])
}
//会员密码找回
function forget_pw(){
	fwajaxStar();
	$.ajax({
		url:"/apply/member/forgetPW.asp",
		data:{sType:""},
		type:"POST",
		dataType:"html",
		cache:"false",
		error: function(){
			fwajaxClose();
			createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("all");}}])
			},
		success:function(data){	
			fwajaxClose();		
			createDialog({title:transKeyWords(globelVary.languageId,8),con:data,type:"edit",head:"no"},[])
			}
		});
	}	
	
/**********会员**end**************/

function memberCenterShow(url) {
			loadContentAjax($(".user_center_sub2"));
            $.ajax({
				url:url,
				dataType:"html",
				cache:false,
				error: function(){
					closeContentAjax($(".user_center_sub2"));
					createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);},
				success:function(data){
					closeContentAjax($(".user_center_sub2"));
					$(".user_center_sub2").html(data);
					
					}
				});
        }	
function memberLogout(){	
	$.ajax({
		url:"/apply/member/login.asp",
		data:{sType:"loginOut"},
		type:"POST",
		dataType:"json",
		cache:"false",
		error: function(){},
		success:function(data){
			if(data.status=="success"){
				closeDialog("all");
				}
			else if(data.status=="falied"){
				createDialog({title:transKeyWords(globelVary.languageId,8),con:data.msg,type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}])
				}
			else {
				createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,13),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}])
				}
			}
		});
	}	

//超时处理
function controlTimeMashine(){//登录后调用,开始计时
	/* var value=$("#timeSessionMashine").val(),
	destroy=$("#timeSessionMashine").attr("destroy");//no表示未曾销毁过,yes表示销毁过
	if(value==""){//session无值,无需做超时处理
		return true;
		}
	else{//已登录	 */
		clearTimeout(globelVary.timeMashine); 	
		globelVary.timeMashine=setTimeout(function(){globelVary.sessionTimeBool=1;$("#timeSessionMashine").val("");},1000*60*20-20);//超时
		//}
	}

function getSessionTimeBool(){//每次ajax请求时调用,返回false后面的ajax不在调用,返回true表示未超时,可以继续执行后面的代码
	//controlTimeMashine();
	//var bool=true;
	 if(globelVary.sessionTimeBool==1){
		 //bool=false;
		 window["destroySessionAjax"]=1;
		$.ajax({			
			url:"/apply/member/logout.asp",
			type:"GET",
			cache:false,
			error: function(){
				createDialog({title:transKeyWords(globelVary.languageId,8),con:transKeyWords(globelVary.languageId,1),type:"error",width:300},[{name:transKeyWords(globelVary.languageId,5),action:function(){closeDialog("self");}}]);				
				},
			success:function(){				
				if(confirm("登录超时,请重新登陆?"))
					window.top.location.reload();
				else 
					window.top.location.reload();
					
				}
			});
		} 
		//return bool;
	}